package network;

import java.util.HashMap;

public class DistanceCouple {

	public HashMap<String, Integer> distances;

	public DistanceCouple() {
		distances = new HashMap<String, Integer>();
	}

	public synchronized boolean alterDistances(String target, int cost) {
		boolean answer;
		answer = distances.containsKey(target) && distances.get(target) == cost;
		distances.put(target, cost);
		return answer;
	}

}
